package com.topnav.mc.admin.entity;

/*
import javax.persistence.Entity;
import javax.persistence.Table;
*/

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.topnav.mc.entity.base.BaseEntity;
import com.topnav.mc.validator.group.IAdd;
import com.topnav.mc.validator.group.IUpdate;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 说明：
 * @类名: Device
 * <p> 设备实体表
 *
 * </p>
 * @author   kenny
 * @Date	 2021年12月1日下午5:27:05
 */
@Data
@Accessors(chain = true)
@TableName("mc_device")
public class Device extends BaseEntity{
	/** */
	private static final long serialVersionUID = 5229096938457080937L;
	@ApiModelProperty(value="编号")
	@NotBlank(message = "设备编号必须填",groups={IAdd.class})
	private String code;

	@ApiModelProperty(value="名称")
	@NotBlank(message = "设备名称必须填",groups={IAdd.class})
	private String name;

	/** 对应DeviceType  */
	@ApiModelProperty(value="类型：1、 普通执法仪，2、视频设备, 3、监控摄像头")
	@NotNull(message = "设备类型必须填",groups={IAdd.class})
/*    @Min(value=1,message = "必须1-3",groups={IAdd.class})
    @Max(value=3,message = "必须1-3",groups={IAdd.class})*/
	private Integer type;

	/** 对应 DeviceCate */
	@ApiModelProperty(value="类型：1、单机执法仪，2、联网执法仪 ")
	private Integer cate;

	@ApiModelProperty(value="组织机构id")
	private Long orgId;
	@ApiModelProperty(value="用户id")
	private Long userId;
	@ApiModelProperty(value="国标服务器id")
	private Long gbServerId;
	@ApiModelProperty(value="默认视频通道")
	private String defaultChannel;
	@ApiModelProperty(value="默认报警通道")
	private String defaultAlarmChannel;

	@ApiModelProperty(value="状态：1、正常，2、报废, 3、维修")
	@NotNull(message = "不允许为空",groups={IAdd.class})
	private Integer state;

	@ApiModelProperty(value="订阅位置信息")
	@NotNull(message = "不允许为空",groups={IAdd.class})
	private Integer subscriberPosition;
	private Integer subscriberPositionInterval;
	@ApiModelProperty(value="目录订阅，定期传输设备电源及硬件状态信息")
	@NotNull(message = "不允许为空",groups={IAdd.class})
	private Integer subscriberCatalog;
	@ApiModelProperty(value="报警订阅，定期通过报警信息上传定位")
	@NotNull(message = "不允许为空",groups={IAdd.class})
	private Integer subscriberAlarm;

	@ApiModelProperty(value="通道数")
	private Integer channelCount=0;

	@ApiModelProperty(value="在线状态")
	//@TableField(exist=false)
	private Boolean online;

	//是否启用音频
	private Boolean hasAudio;

	//是否已同步
	private Boolean synch;

	private Double longitude;
	private Double latitude;
	private Date positionTime;

	private String coordinateSystem="WGS84"; //坐标系 WGS84，GCJ02

	private String streamMode="UDP";// UDP/TCP  传输  TCP-PASSIVE：tcp被动模式 TCP-ACTIVE：tcp主动模式

	private String batteryInfo;//电量
	private String storage;//存储
	private String usedMemory;//使用内存
	private String remainMemory;//剩余内存
	private String recordStatus;//状态

	private String imeiCode;//IMEI号
	private String talkAccount;//对讲帐号
	private String talkId;//对讲帐号ID

	@TableField(exist=false)
	private Integer onOfflineEvent; // 0 下线

	@TableField(exist=false) // 1 上线
	private Date eventTime;

	//AES256加密密钥
	private String streamEncryption;

/*	@TableField(exist=false)
	private Organization organization;

	@TableField(exist=false)
	//@Transient
	private User user;

	@TableField(exist=false)
	private GbServer gbServer;*/

}
